﻿Imports myBookmarks.Core
Namespace myBookmarks.Web

    Public MustInherit Class BaseBookmarkViewModel
        Inherits BaseViewModel

        Private _title As String
        Public Property Title() As String
            Get
                Return _title
            End Get
            Set(ByVal value As String)
                _title = value
            End Set
        End Property


        Private _selectedMenu As String
        Public Property SelectedMenu() As String
            Get
                Return _selectedMenu
            End Get
            Set(ByVal value As String)
                _selectedMenu = value
            End Set
        End Property

        Private _userLabels As List(Of Label)
        Public Property UserLabels() As List(Of Label)
            Get
                Return _userLabels
            End Get
            Set(ByVal value As List(Of Label))
                _userLabels = value
            End Set
        End Property

        Private _LabelCountByBookmarks As IEnumerable(Of KeyValuePair(Of String, Integer))

        Public Property LabelCountByBookmarks() As IEnumerable(Of KeyValuePair(Of String, Integer))
            Get
                Return _LabelCountByBookmarks
            End Get
            Set(ByVal value As IEnumerable(Of KeyValuePair(Of String, Integer)))
                _LabelCountByBookmarks = value
            End Set
        End Property

        Public ReadOnly Property UserLabelList() As String
            Get
                Dim l = (From la In UserLabels _
                                    Select name = String.Format("""{0}""", la.LabelName)).ToArray
                Return String.Join(",", l)
            End Get
        End Property
    End Class
End Namespace